"use strice";

const Controller = require('../common/api')

class goodsController extends Controller {
  tableName = 'goods'
  // 查询商品列表
  async getGoods() {
    let result = await this.consult()
    this.resData(0, '商品列表获取成功', result)
  };

  async getGoodsDetail() {
    let goods_id = await this.ctx.request.query.goods_id
    let result = await this.app.mysql.query(`SELECT * FROM goods WHERE goods_id=?`, [goods_id])
    this.resData(0, '商品详情获取成功', result)
  }
}

module.exports = goodsController